<template>
  <ul class="timeline-wrapper">
    <li class="timeline-item" v-for="item in timelineList" :key="item.title">
      <div class="timeline-box">
        <div class="out-circle">
          <div class="in-circle"></div>
        </div>
        <div class="long-line"></div>
      </div>
      <div class="timeline-content">
        <div class="timeline-time">
          <div class="time">{{ item.time }}</div>
          <div class="sanjiao"></div>
        </div>
        <div class="timeline-title" :style="{color: item.color}">{{ item.title }}</div>
      </div>
    </li>
  </ul>

</template>

<script lang="ts" setup>
defineProps({
  timelineList: {
    type: Array<{ title: string, time: string, color: string }>,
  }
})
</script>

<style scoped lang="scss">
ul.timeline-wrapper {
  list-style: none;
  margin: 0;
  margin-top: 40px;
}

/* 时间线 */
.timeline-item {
  position: relative;

  .timeline-box {
    text-align: center;
    position: absolute;

    .out-circle {
      width: 20px;
      height: 20px;
      background: rgba(14, 116, 218, 0.1);
      box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.1);
      /*opacity: 0.1;*/
      border-radius: 50%;
      display: flex;
      align-items: center;

      .in-circle {
        width: 20px;
        height: 20px;
        margin: 0 auto;
        background: #FFFFFF;
        border: 2px solid #3D7BD5;
        border-radius: 50%;
        box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.1);
      }
    }

    .long-line {
      width: 2px;
      height: 98px;
      background: #3D7BD5;
      box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.1);
      opacity: 1;
      margin-left: 8px;
    }
  }

  .timeline-content {
    box-sizing: border-box;
    margin-left: 20px;
    height: 70px;
    padding: 0 0 0 20px;
    text-align: left;

    .timeline-title {
      font-size: 14px;
      word-break: break-all;
      margin-bottom: 16px;
      color: #333;
      font-weight: 500;
      /*display: inline;*/
    }

    .timeline-date {
      font-size: 16px;
      color: #333;
      font-weight: 500;
      margin-bottom: 16px;
    }

    .timeline-desc {
      font-size: 14px;
      color: #999999;
    }
  }

}

.timeline-item:last-of-type .timeline-content {
  margin-bottom: 0;
}

.timeline-time {
  display: flex;
  justify-content: space-between;
  align-items: center;

  .time {
    color: #266CA2;
    font-weight: 400;
  }
  .sanjiao {
    border-style: solid;
    border-color: transparent;
    border-width: 10px 0 10px 10px;
    border-left-color: #266CA2;
  }
}
</style>